import request from '@/utils/request'

export function fetchGovernanceNormsList(data) {
  return request({
    url: '/system/standardsystem/GovernanceNorms/list',
    method: 'post',
    data,
  })
}

export function getGovernanceNorms(id) {
  return request({
    url: '/system/standardsystem/GovernanceNorms/info/' + id,
    method: 'get',
  })
}

export function createGovernanceNorms(data) {
  return request({
    url: '/system/standardsystem/GovernanceNorms/save',
    method: 'post',
    data,
  })
}

export function updateGovernanceNorms(data) {
  return request({
    url: '/system/standardsystem/GovernanceNorms/update',
    method: 'post',
    data,
  })
}

export function deleteGovernanceNorms(data) {
  return request({
    url: '/system/standardsystem/GovernanceNorms/update',
    method: 'post',
    data,
  })
}
// export function deleteTable(data) {
//   console.log(data, '11111111111111111111111')
//   return request({
//     url: '/system/standardsystem/GovernanceNorms/delete',
//     method: 'post',
//     headers: { 'Content-Type': 'application/json' },
//     data,
//   })
// }

export function deleteTable(data) {
  return request({
    url: '/system/standardsystem/GovernanceNorms/delete',
    method: 'post',
    headers: {
      'Content-Type': 'application/json',
    },
    data: data, // JSON.stringify 如果需要可以在这里使用，但axios自带处理JSON的能力
    transformRequest: [
      (data, headers) => {
        // 如果headers中的Content-Type为application/json，则在这里处理JSON.stringify
        if (headers['Content-Type'] === 'application/json') {
          return JSON.stringify(data)
        }
        // 其他情况，使用默认行为
        return data
      },
    ],
  })
}

export function release(data) {
  return request({
    url: '/system/standardsystem/GovernanceNorms/release',

    method: 'post',
    data,
  })
}
export function upFile(data) {
  return request({
    url: '/system/standardsystem/GovernanceNorms/upload',
    method: 'post',

    data,
  })
}
export function upDown(data) {
  return request({
    url: '/system/standardsystem/GovernanceNorms/download',
    method: 'post',
    data: data,
  })
}
